home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / dos #31 < prev    next >
Text File  |  2022-08-26  |  2KB  |  111 lines

  1.  
  2.       DOS & Don'ts -- Part 31
  3.           by Jimmy Weiler
  4.  
  5.  
  6.   And now, for all you readers without
  7.  
  8. printers, a view of the whole Q&D DIR
  9.  
  10. DISPLAY program:
  11.  
  12.  
  13. 1020 OPEN15,8,15,"I0"
  14. 1030 Z$=CHR$(0): IL$=CHR$(128):
  15.      Q$=CHR$(34): SP$=CHR$(160)
  16. 1040 DIM F$(29)
  17. 1050 TY$(0)="DEL": TY$(1)="SEQ":
  18.      TY$(2)="PRG": TY$(3)="USR":
  19.      TY$(4)="REL"
  20. 1060 OPEN8,8,8,"$"
  21. 1070 BU=0
  22. 1080 FOR C1=1 TO 142:GET#8,K$:NEXT
  23. 1090 PRINT"NAME:<rvon>"; FOR C1=144 TO
  24.      160: GET#8,K$: PRINT K$;: NEXT
  25.      PRINT "<rvof> ";
  26. 1100 GET#8,L$,M$,N%: PRINT"ID:"M$;N$
  27. 1110 FOR C1=164 TO 255: GET#8,K$:NEXT
  28. 1120 FOR FILE=1 TO 144
  29. 1130 FOR BYTE=0 TO 29: GET#8,F$(BYTE):
  30.      NEXT: IF ST=66 THEN FILE=150:
  31.      GOTO 1240
  32. 1140 F$(0)=F$(0)+Z$
  33. 1150 IF F$(0)<IL$ THEN 1220
  34. 1160 PRINT TY$(ASC(F$(0))-128);": ";
  35. 1170 PRINT Q$;: FOR LTTR=3 TO 18: IF
  36.      F$(LTTR) <> SP$ THEN PRINT
  37.      F$(LTTR);
  38. 1180 NEXT: PRINT Q$;
  39. 1190 SZ=256*ASC(F$(29)+Z$)+ASC(F$(28))
  40. 1200 PRINT TAB(23-(SZ<100)-(SZ<10))SZ
  41.      "BLOCK";:IF SZ<>1 THEN PRINT"S";
  42. 1210 PRINT
  43. 1220 IF FILE/8 <> INT(FILE/8)THEN
  44.      GET#8,L$,M$
  45. 1230 BU=BU+SZ: SZ=0
  46. 1240 NEXT FILE:
  47.      PRINT BU"OF 664 BLOCKS USED."
  48.  
  49.  
  50.   When the directory is read as a
  51.  
  52. file, each block contains 254
  53.  
  54. accessible characters.  Remember that
  55.  
  56. zero is significant, so the characters
  57.  
  58. are only numbered up to 253.  These
  59.  
  60. charts describe the layout of each
  61.  
  62. block.
  63.  
  64. First block: BAM & Header
  65.  
  66. Char.    Description
  67. --------------------------------------
  68.   2-141  BAM
  69. 142-159  Disk Name
  70. 160-161  Disk ID
  71. --------------------------------------
  72.  
  73. Subsequent blocks: Directory
  74. --------------------------------------
  75. Char.    Description
  76.   0- 29  File entry 1
  77.  32- 61  File entry 2
  78.  64- 93  File entry 3
  79.  96-125  File entry 4
  80. 128-157  File entry 5
  81. 160-189  File entry 6
  82. 192-221  File entry 7
  83. 224-253  File entry 8
  84.  
  85. --------------------------------------
  86. File entry structure:
  87. Char.    Description
  88. --------------------------------------
  89.       0  File type.
  90.   1-  2  Track & sector of first file
  91.          data block.
  92.   3- 18  File name.
  93.  19- 20  Relative file-- first side
  94.          sector track and sector.
  95.      21  Relative file record size.
  96.  28- 29  Number of blocks in the file.
  97. --------------------------------------
  98.  
  99.  
  100.   For detailed information about 1541
  101.  
  102. directories, see pages 24 and 25 of
  103.  
  104. the VIC-1541 SINGLE DRIVE FLOPPY DISK
  105.  
  106. USER'S MANUAL, the booklet that comes
  107.  
  108. in the box when you buy a 1541 drive.
  109.  
  110. =========< end of article >===========
  111.